package com.example.qxfw.common.util;

import java.io.File;
import java.util.Map;

/**
 * @author 14559
 * @version 1.0
 * @description: TODO
 * @date 2025/1/14 17:41
 */
public class GetPath {
    public static String action(Map<String, Object> Map, String path, String collectionName) {
        switch (collectionName) {
            case "doc_file":
            case "pdf_file":
            case "image_file":
            case "txt_file":
            case "video_file":
            case "model_file":
                path = path + Map.get("table_name") + File.separator + Map.get("id");
                break;
            case "yb_rain_png_file":
            case "yb_temp_png_file":
            case "yb_press_png_file":
            case "yb_wind_png_file":
            case "yb_humid_png_file":
            case "yb_rain_jpg_file":
            case "yb_temp_jpg_file":
            case "yb_press_jpg_file":
            case "yb_wind_jpg_file":
            case "yb_humid_jpg_file":
            case "grid_file":
            case "grid_cmpas_file":
            case "grid_micaps_file":
            case "grid_cmameso_file":
                path = path + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("ntimes") + File.separator + Map.get("type");
                break;
            case "ld_file":
            case "ld_png_file":
            case "ld_jpg_file":
                path = path + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("ldtype") + File.separator + Map.get("elevation") + File.separator + Map.get("stationid");
                break;
            case "yt_file":
            case "yt_jpg_file":
            case "yt_png_file":
            case "yt3d_file":
            case "yt3d_png_file":
            case "yt4b_file":
            case "yt4b_png_file":
                path = path + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("yttype");
                break;
            case "sk_temp_png_file":
            case "sk_humid_png_file":
            case "sk_wind_png_file":
            case "sk_press_png_file":
            case "sk_rain_png_file":
            case "sk_temp_jpg_file":
            case "sk_humid_jpg_file":
            case "sk_wind_jpg_file":
            case "sk_press_jpg_file":
            case "sk_rain_jpg_file":
                path = path + Map.get("datechar") + File.separator + Map.get("type");
                break;
            case "forecastrain_grid_file":
            case "forecastrain_grid_map_file":
            case "staff_jpg_file":
            case "ImWo_jpg_file":
            case "ImNo_jpg_file":
            case "weatherchart_jpg_file":
                path = path + Map.get("table_id");
                break;
            case "zwld_file":
                path = path + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("ldtype");
                break;
            case "grid_jpg_file":
                path = path + Map.get("dateyear") + File.separator + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("forecast") + File.separator + Map.get("ele") + File.separator + Map.get("type");
                break;
            case "sk_jpg_sl_file":
            case "sk_png_sl_file":
                path = path + Map.get("drainagearea") + File.separator + Map.get("datetime") + File.separator + Map.get("type") + File.separator + Map.get("sx");
                break;
            case "yb_jpg_sl_file":
                path = path + Map.get("drainagearea") + File.separator + Map.get("datetime") + File.separator + Map.get("timechar") + File.separator + Map.get("sx");
                break;
            case "yb_png_sl_file":
                path = path + Map.get("drainagearea") + File.separator + Map.get("datetime") + File.separator + Map.get("timechar") + File.separator + Map.get("sx");
                break;
            case "rain_grid_file":
                path = path + Map.get("datechar") + File.separator + Map.get("type") + File.separator + Map.get("sx");
                break;
            case "qpf_grid_file":
                path = path + Map.get("datechar") + File.separator + Map.get("ntimes");
                break;
            case "haze_file":
                path = path + Map.get("filename");
                break;
            case "quhuatu_file":
                path = path + Map.get("qh_class") + File.separator + Map.get("layer_type") + File.separator + Map.get("layer_name") + File.separator + Map.get("filetype");
                break;
            case "quhuatu_image_file":
                path = path + Map.get("qh_type");
                break;
            case "grid_warn_analysis_file":
                path = path + Map.get("table_id");
                break;
            case "middle_long_file":
                path = path + Map.get("dtetime") + File.separator + Map.get("filename");
                break;
            case "disweather_png_file":
                path = path + Map.get("datechar") + File.separator + Map.get("type");
                break;
            case "farm_image":
                path = path + Map.get("dtetime") + File.separator + Map.get("timechar") + File.separator + Map.get("stationid");
                break;
            case "sk_jpg_rain_file":
            case "yb_jpg_rain_file":
            case "yb_png_rain_file":
                path = path + Map.get("datetime") + File.separator + Map.get("type") + File.separator + Map.get("areatype") + File.separator + Map.get("drainagearea") + File.separator + Map.get("ntimes");
                break;
            case "ld_jpg_sl_file":
            case "ld_s_jpg_sl_file":
                path = path + Map.get("drainagearea") + File.separator + Map.get("datetime");
                break;
            case "qpf_jpg_sl_file":
            case "qpf_png_sl_file":
                path = path + Map.get("datechar") + File.separator + Map.get("ntimes") + File.separator + Map.get("drainagearea");
                break;
            case "ybzz_final_grid":
                path = path + Map.get("type") + File.separator + Map.get("datechar") + File.separator + Map.get("timechar") + File.separator + Map.get("forecasttype") + File.separator + Map.get("ntimes");
        }

        return path;
    }
}

